﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;

namespace Skecthial.UI.Controls
{
    public partial class DragAndDrop : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {


        }

        public void rp1_dataBound(object sender, EventArgs e)
        {

        }

        public DataTable GetFiles(string folder)
        {
            DataTable dt2 = new DataTable();
            dt2.Columns.Add("id");
            FileInfo fi = new FileInfo(Server.MapPath("~/Objects/" + folder + "/"));
            DirectoryInfo di = fi.Directory;
            FileInfo[] fsi = di.GetFiles();
            //Response.Write("The directory contains the following files and directories:" + di.FullName + "<hr>");
            foreach (FileSystemInfo info in fsi)
            {
                DataRow dr2 = dt2.NewRow();
                dr2[0] = info.Name;
                dt2.Rows.Add(dr2);
            }

            return dt2;
        }
    }
}